package com.alipay.config;

import java.io.FileWriter;
import java.io.IOException;

public class AlipayConfig {

    //↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

    // 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
    public static String app_id = "2018101261690035";

    // 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCJBKpHSfyAetPpo650ZXdNtPgM5NT9wWw9QMtJQDkbMCyBKoQDGFqPXv7O2Hx7+dtCrxRzWKNb0qTBwJ+8Mtxl6UdY8ZuuEGfLZhrXlqpo9o4fwLhrzUq9G+XeKXb0T2Pxkb78QzeIdpyDyte71qqiombPq5BpZI1dtHsdZxud20Psosdp/Izq6AqUbTK4j5IO388efeh+gCNP5R7mBMbrix8mAro3SpyrtTEMIcYRCkNTybUx1TOeLg3ocvYJ8v3aDoU12otEfE2Ylh5y6Mw1QzLOaXm+0R3APot3kG9NU8STZ/oXhRzuQEzyNbOlTy/eJ4AMvYW4ibvms2BjawLHAgMBAAECggEAHtvWHcgj/iurnmsm10Ai5nVjiEPhVGVDo2f8YLr+IYlv/Ic+xBOwEaoraRqIrsNPBm24BWJpKD0ArkJbt18dFDa9wuJnVYSMW9rbIMLmDk25JJ2a62yI8J5f3vEnwU5ADB/vC5F36FwOVABTJhLqy0YYMZ1KIPJshDYppC2coqhwHM4OiDtM7XS2E8B7vfJI2P7hHBpVK80hF1UWtdzvivzMRQJNwPIghb4Q1UEVEL/4yyz73lVbJTrQzk/3SXN8QAZyjKqgG+wcGTsI8JkSBu+5hK6cbwnIzd2QLvRLaKjszyYC7BSZ2T0Ywf5foAwDzSe1X0g7kC/2926UZRmpQQKBgQDzFXexeUb0T2pwjp5RQxBHZQ94q0NQrPzgwtRflO2bcS/HYR3hAtXIEu7BAibN57xRuOTv8uWtGl+lFdjzVvUtLwhwX66yPIhWjPgEEnnoYmaPbb687Twzc+/mhDDapNeaNGV/ze8T2Pn2+F9Fpe4q8M94PZZXFiC92Pci7WhrdQKBgQCQTHJY2V30CGI0uYTLkCwPf1wqItS52GkW57P0i/9ZaBrV3VbbF1H6VwfQsUihjCX0veXlqBbn3/lRfhZgDj48jqvY11SO9kIVM3RwesLt0FV8CLHu8w1bHFOsXXEpUNtBZyWvZMo+H9aa0DoGyt34JDq1r0gEcjOWRs42LpX5ywKBgQDMHLySo1k3D/A6byb06TEkIfHpyzUM6xSzziTx1WXm3hXWfu/N3smP5IXiP2JCB1IT9QMXkIfW4IxrXHr9aYkZ1aJqaY2RUE7TDi+7i6Adx3KDAQ3mKfYg5jsM/vbewQfhDhokRNF5gvnxrQCixP/FwssTFfPFUGlRwHtUMrE5eQKBgEejLEGf6Fz2rIqwb5UABl/LQt5IXIPHRKTycwy9VA/29xulvzEV6sT14BNjcEODaHSQsknJoVWMhCJJDqKxb4Rw8C++92PiLfyIhw4wZAXcoBPr3Spb0A2jiobP/RYd5jwaEUN6Lk2ZUNma9rPYk0pV8i+wzXgnmiTJEickCaDxAoGADHtBhvbAj9YWOEngTAYYjxIBXEa5sMppppa4B7k83BFiQ9rcL8/mmdebseuSKkhectMUBHJa8wDYGLshV3TpBcs2TrQLL4nfkO3Ow758N8oEn3eRbi+7DzQStid6yDMpHC6fegfiBueGNWvfkLBodDcS44SfWP5mMkaERIBSjms=";

    // 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAiQSqR0n8gHrT6aOudGV3TbT4DOTU/cFsPUDLSUA5GzAsgSqEAxhaj17+zth8e/nbQq8Uc1ijW9KkwcCfvDLcZelHWPGbrhBny2Ya15aqaPaOH8C4a81KvRvl3il29E9j8ZG+/EM3iHacg8rXu9aqoqJmz6uQaWSNXbR7HWcbndtD7KLHafyM6ugKlG0yuI+SDt/PHn3ofoAjT+Ue5gTG64sfJgK6N0qcq7UxDCHGEQpDU8m1MdUzni4N6HL2CfL92g6FNdqLRHxNmJYecujMNUMyzml5vtEdwD6Ld5BvTVPEk2f6F4Uc7kBM8jWzpU8v3ieADL2FuIm75rNgY2sCxwIDAQAB";

    // 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_url = "http://localhost:8088/alipay.trade.page.pay-JAVA-UTF-8/notify_url.jsp";

    // 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String return_url = "http://localhost:8088/alipay.trade.page.pay-JAVA-UTF-8/return_url.jsp";

    // 签名方式
    public static String sign_type = "RSA2";

    // 字符编码格式
    public static String charset = "utf-8";

    // 支付宝网关
    public static String gatewayUrl = "https://openapi.alipay.com/gateway.do";

    // 支付宝网关
    public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /**
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }

}
